package org.jeecg.cn.edu.scau.vm.container.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.jeecg.cn.edu.scau.vm.container.domain.VmContainer;

import java.time.LocalDateTime;

@Mapper
public interface VmContainerMapper extends BaseMapper<VmContainer> {
    /**
     * @param status      状态码
     * @param containerId 容器ID
     * @param updateTime  更新时间
     * @param updateBy    更新者
     */
    @Update("UPDATE vm_container " +
            "SET status = #{status} " +
            ", update_by = #{updateBy} " +
            ", update_time = #{updateTime} " +
            "WHERE container_id = #{containerId}")
    void updateStatusById(@Param("status") Integer status,
                          @Param("containerId") String containerId,
                          @Param("updateTime") LocalDateTime updateTime,
                          @Param("updateBy") String updateBy);


}
